#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

class Solution {
public:
    vector<int> minSubsequence(vector<int> &nums)
    {
        sort(nums.begin(), nums.end());  // 排序
        auto total = accumulate(nums.begin(), nums.end(), 0);  // 求和
        vector<int> res;  // 返回的子串
        int curr = 0;
        for (int i = nums.size() - 1; i >= 0; --i) {
            curr += nums[i];
            res.push_back(nums[i]);
            if (total - curr < curr) {
                break;
            }
        }
        return res;
    }
};

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}
